<template>
  <view>
    <nav-bar class="wxNav" type="transparent" fontColor="#000">我的</nav-bar>
    <!-- 登录页 -->
    <UserLogin
      ref="UserLogin"
      v-if="Object.keys(loginInfo).length === 0"
    ></UserLogin>
    <!-- 信息页 -->
    <MyInfo v-else :serviceList="serviceList"></MyInfo>
  </view>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import navBar from "@/components/zhouWei-navBar/zhouWei-navBar"
export default {
    components: {navBar},
  data() {
    return {
      scrollTop: 0,
      // 分享内容
      shareMixin: {
        title: '个人中心',
        path: '/pages/MyInfo',
      },
    }
  },
  computed: {
    ...mapState(['loginInfo']),
  },
  onShow() {
    uni.showTabBar()
    // 获取登录logo
    if (Object.keys(this.loginInfo).length === 0) {
      this.$refs.UserLogin.getCode()
    }
  },
  methods: {
    onPageScroll(e) {
      this.scrollTop = e.scrollTop;
    }
  },
}
</script>
<style lang="scss" scoped>
.wxNav {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99;
  width: 750rpx;
  background-color: transparent !important;
}
.info_box {
  margin: 30rpx;
  .info_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20rpx;
    padding-top: 20rpx;
    border-top: 1px solid #ddd;
    &.noborder {
      border: none;
    }
    .info {
      flex: 1;
      padding: 0 20rpx;
      font-size: 26rpx;
      .photo {
        color: $theme-color;
      }
    }
  }
  .icon {
    display: flex;
    flex-direction: column;
    width: 120rpx;
    height: 120rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24rpx;
  }
}
</style>
